package.path='./lua/?.lua;./lib/lua/?.lua;'..package.path
if not OS then
	if os.getenv("WINDIR") then
		OS='WIN32'
	else
		local uname=io.popen("uname -smp")
		if uname then
			local u=uname:read() or ''
			local s,m,p=string.match(u,"^(%S+)%s(%S+)%s(%S+)")
			if s=='Darwin' then
				if m=='x86_64' then
					OS='MAC64'
				else
					OS='MAC'
				end
			elseif s=='Linux' then
				if m=='x86_64' then
					OS='LINUX64'
				else
					OS='LINUX'
				end
			else
				print(s,m,p)
				error'unknow OS'
			end
		else
			error'unknow OS'
		end
	end
end
print('--','OS',OS)

if OS=='WIN32' then
	package.cpath='./lib/win32/?.dll;'..package.cpath
elseif OS=='MAC64' then
	package.cpath='./lib/mac64/?.so;'..package.cpath
elseif OS=='LINUX' then
	package.cpath='./lib/centos32/?.so;'..package.cpath
elseif OS=='LINUX64' then
	package.cpath=ZDC_DIR..'lib/centos64/?.so;'..package.cpath
else
end

ZLoadConf=ZLoadConf or function (f,...)
	return assert(loadfile((ZCONFDIR or './conf/')..f))(...)
end

--REACTMOD='zsvc.react'
local r,msg=pcall(require,REACTMOD)
if not r then
	if REACTMOD then
		print(msg)
		print("fall to zdc.react")
	end
	REACTMOD='zsvc.react'
else
	print("use REACTMOD",REACTMOD)
end
